package com.hbpu.encap.arrays;

import java.util.Scanner;

public class Homework04 {
    public static void main(String[] args) {
        System.out.print("请输入字符串：");
        String input = new Scanner(System.in).next();
        count(input);
    }

    public static void count(String input) {
        char[] charArray = input.toCharArray();
        int numCount = 0;
        int upCaseCount = 0;
        int lowCaseCount = 0;
        for (char c : charArray) {
            if (c >= '0' && c <= '9') {
                numCount++;
            }
            if (c >= 'A' && c <= 'Z') {
                upCaseCount++;
            }
            if (c >= 'a' && c <= 'z') {
                lowCaseCount++;
            }
        }
        System.out.println("该字符串中有数字：" + numCount + "个，大写字母：" + upCaseCount + "个，小写字母：" + lowCaseCount + "个。");
    }
}
